package com.bestvike.portal.enums;

public enum UserStatus {
    NORMAL("0000", "正常"),
    DELETED("9999", "已删除");

    UserStatus(String code, String name) {
        this.code = code;
        this.name = name;
    }
    private String code;
    private String name;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String translate(String code) {
        for (UserStatus userStatus : UserStatus.values()) {
            if (userStatus.getCode().equals(code)) {
                return userStatus.getName();
            }
        }
        return null;
    }
}